<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>
        {% block title %}
        {% endblock %}
    </title>
    <link rel="stylesheet" href="{{url_for('static', filename='bootstrap/dist/css/bootstrap.min.css')}}">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{url_for('static', filename='css/main.css')}}">
    <link rel="stylesheet" href="{{url_for('static', filename='font-awesome/web-fonts-with-css/css/fontawesome.min.css')}}">
    {% block css %}{% endblock %}
    <script src="{{url_for('static', filename='jquery/dist/jquery.min.js')}}"></script>
    <script src="{{url_for('static', filename='bootstrap/dist/js/bootstrap.min.js')}}"></script>
    <script src="{{url_for('static', filename='js/main.js')}}"></script>
</head>
<body>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbar-collpase" aria-expanded="false">
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{url_for('home.index')}}">
                    <img class="logo" src="{{url_for('static', filename='images/logo.png')}}" alt="">
                </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-collpase">
                <ul class="nav navbar-nav">
                    <li class="active">
                        <a href="{{url_for('home.index')}}">首页</a>
                    </li>
                    <li>
                        <a href="">话题</a>
                    </li>
                </ul>
                <form action="" class="navbar-form navbar-left">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="搜索微博、找人">
                    </div>
                    <button class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    {% if current_user.get_id() %}
                        <li class="dropdown">
                            <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button">
                                {{current_user.username}}
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="{{url_for('user.logout')}}">退出登录</a></li>
                            </ul>
                        </li>
                    {% else %}
                        <li><a href="{{url_for('user.login')}}">登录</a></li>
                        <li><a href="{{url_for('user.register')}}">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>
    <div class="alert-group">
        {% if get_flashed_messages()[0] and get_flashed_messages()[0].success %}
            <div id="alert" class="alert alert-success alert-dismissible" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                {{get_flashed_messages()[0].success}}
            </div>
        {% endif %}
    </div>

    <div class="content">
        {% block content %}
        {% endblock %}
    </div>
    {% block scripts %}
    {% endblock %}
    <div class="footer">
        微博 &copy;2018 published by liuwenchao
    </div>
</body>
</html>